package org.academic.texteditor.gui.style;

import java.awt.Color;
import java.awt.Font;
import java.awt.Paint;

import javax.swing.SwingConstants;
import javax.swing.border.Border;

public class Style {

	public static final int LEFT = SwingConstants.LEFT;
	public static final int CENTER = SwingConstants.CENTER;
	public static final int RIGHT = SwingConstants.RIGHT;

	private String name;
	private Font font;
	private Paint color;
	private Color background;
	private Color foreground;
	private Border border;
	private int alignment = LEFT;

	public Style(String name) {
		this.name = name;
	}

	public Paint getColor() {
		return color;
	}

	public void setColor(Paint color) {
		this.color = color;
	}

	public Color getBackground() {
		return background;
	}

	public void setBackground(Color background) {
		this.background = background;
	}

	public Color getForeground() {
		return foreground;
	}

	public void setForeground(Color foreground) {
		this.foreground = foreground;
	}

	public Font getFont() {
		return font;
	}

	public void setFont(Font font) {
		this.font = font;
	}

	public String getName() {
		return name;
	}

	public Border getBorder() {
		return border;
	}

	public void setBorder(Border border) {
		this.border = border;
	}

	public int getAlignment() {
		return alignment;
	}

	public void setAlignment(int alignment) {
		switch (alignment) {
			case LEFT:
			case CENTER:
			case RIGHT:
				this.alignment = alignment;
				break;
			default:
				throw new RuntimeException("Use the constants: Style.LEFT, Style.CENTER or Style.RIGHT");
		}
	}

}

